﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="a.aspx.cs" Inherits="ShareMarking.Web.a" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="scripts/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="js/tool.js" type="text/javascript"></script>
    <title></title>
<script type="text/javascript">
    $(function () {
        var code = GetQueryStringName("c"); //获取查询代码
        var ip = '<%=IP %>'; //获取访问IP
        var province = '<%=Province %>'; //获取访问的省份
        var city = '<%=City %>'; //获取访问的城市
        var isp = '<%=ISP %>'; //获取访问的运营商
        //var system = getOSAndBrowser();//获取操作系统
        var ipadderss = province + ":" + city;

        $.ajax({
            async: false,
            url: "/geturlapi.ashx?action=geturl",
            type: "POST",
            data: { code: code, ip: ip, ipadderss: ipadderss },
            success: function (res) {
                var result = JSON.parse(res);
                if (result.subcode == "00") {
                    var str = "" + result.resulturl + "";
                    //$("#links").attr("href", "" + result.resulturl + ""); 
                    if (str.indexOf("http://") > -1 || str.indexOf("https://") > -1) {
                        document.getElementById("links").href = str;
                    } else if (str.indexOf("http://") <0) {
                        document.getElementById("links").href = "http://" + str + "";
                    } else if (str.indexOf("https://") <0) {
                        document.getElementById("links").href = "https://" + str + "";
                    }
                    var a = document.getElementById("links");
                    location.href = a.href; //跳转
                } else {
                }
            },
            error: function (ex) {
            }
        });
    })
</script> 
      
</head>
<body>
<a href="" title="" id="links" target="_blank"></a>
</body>
</html>
